package com.java.imauoj.mapper;

import com.java.imauoj.moudel.Classes;
import com.java.imauoj.moudel.User;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface ClassMapper {


    @Select("select * from class where class_id=#{class_id}")
    Classes getClass(@Param("class_id") int class_id);

    @Update("update class set name=#{name},info=#{info} where class_id=#{class_id}")
    void updateClass(Classes cla);

    @Insert("insert into class(name,info) values(#{name},#{info})")
    @Options(useGeneratedKeys=true, keyProperty="class_id", keyColumn="id")
    void addClass(Classes cla);

    @Delete("delete class where class_id=#{class_id}")
    void deleteClass(int class_id);

    @Select("select * from class")
    List<Class> getClassList();


}
